<!DOCTYPE html>
<html>
<head>
<!--    <link rel="stylesheet" type="text/css" href="./index.css">-->
    <meta charset="UTF-8">
    <title>语音播报</title>
</head>
<body>
<div class="dialog">
    <div class="dialog-content">
        <div class="infoBox">
            <div style="margin: auto;">
                <button class="btnA">朗读</button>
                <button class="btnB">暂停</button>
                <button class="btnC">继续</button>
                <button class="btnD">停止</button>
            </div>
            <audio src="http://m10.music.126.net/20230323164455/45e5a62383f7ab38e1e53ddd646177eb/ymusic/5353/0f0f/0358/d99739615f8e5153d77042092f07fd77.mp3">ll</audio>
            <div style="margin: auto;">
                <input type="text" class="infoInput" required="required" value="你好，称重管理系统"/>
            </div>
        </div>
    </div>
</div>

<script>
    let btnA = document.querySelector('.btnA');
     function read(){

        const spk = new SpeechSynthesisUtterance();

        spk.text ='123'

         speechSynthesis.speak(spk);
    }
    btnA.onclick = function () {
        console.log('-------')
        read();
    }

</script>
</body>
</html>
